import {useSystemStore} from '@/stores/system'


export default {
  mounted(el, binding) {
    // 获取父节点（在挂载前元素尚未插入到DOM）
    const systemStore = useSystemStore()
    const parent = el.parentNode;
    // 2. 判断权限是否有访问该元素的权限
    if(binding.value.findIndex(el => systemStore.getPermissions.includes(el)) == -1){
        // 1. 阻止插入的核心方法：将元素从父节点移除
        parent.removeChild(el);
    }
  }
};
